package com.zjbbkj.baibai.netty.controller;

import com.alibaba.fastjson.TypeReference;
import com.zjbbkj.baibai.common.utils.R;
import com.zjbbkj.baibai.common.utils.wanli.RedisCacheUtil;
import com.zjbbkj.baibai.domain.device.Device;
import com.zjbbkj.baibai.netty.feign.DeviceFeignService;
import com.zjbbkj.baibai.netty.pojo.ProtocolMessage;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;

/**
 * @author WanLi
 * @date 2021年08月24日 16:16
 */
@Slf4j
@RestController
public class DemoController {

//    @Resource
//    private RedisCacheUtil redisCacheUtil;

    @Resource
    private DeviceFeignService deviceFeignService;

    @GetMapping("/test")
    public R test(){

/*        redisCacheUtil.set("hello","123123123",0);
//        String s = redisCacheUtil.get("hello").toString();
//        log.info(s);
//        ProtocolMessage p = new ProtocolMessage();
//        p.setDeviceAddTime(DateUtils.getStringDate());
//        p.setIMEIID("123");
//        redisCacheUtil.set("123",p);
/       ProtocolMessage p2 =  (ProtocolMessage)redisCacheUtil.get("123");
*/

        //return R.ok().put("data",deviceFeignService.getDevice("867881048853621"));
        Device device = new Device();
        device.setDeviceId("132456797687649");
        device.setDeviceImei("8678810488536982");
        return deviceFeignService.insertDevice("");

    }
}
